<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // try
        // catch()
        // finally //终于 - 最终
        try {
            console.log('没有错');
            123()
            console.log(a);
            // 后面不执行
        } catch (err) {
            console.log(err);
        } finally {
            // 不管有没有错误，都会执行
            console.log('完了');
        }

        console.log("完了");
    </script>
</body>

</html>